set more 1

/*
File:	cepr_basic_geog.do
Date:	Nov 21, 2006
	Feb 15, 2008
	Feb 10, 2009
	Jan 4, 2010
	Feb 22, 2011
	Jan 3, 2011
	Jan 3, 2013
	Dec 20, 2013
	Mar 12, 2015, CEPR ORG Version 2.0
	Apr  1, 2015, CEPR ORG Version 2.0.1
	March 1, 2016, CEPR ORG Version 2.1
	Oct 12, 2016, CEPR ORG Version 2.1.1
	Feb 9, 2017, CEPR ORG Version 2.2
	Apr 21, 2017, CEPR ORG Version 2.2.1
	Apr 10, 2018, CEPR ORG Version 2.3
	Mar 22, 2019, CEPR ORG Version 2.4
	Jul 24, 2019, CEPR ORG Version 2.4.1
	Feb 05, 2020, CEPR ORG Version 2.5
	
Desc:	Creates consistent geographical variables for CEPR consistent
	extract	of Basic CPS
Note:	See copyright notice at end of program.
*/

/* note: any pre-1994 data processing is not yet correct;
         use only to process data from 1994 forward
*/

/* Determine data year */
local year=year in 1

/* State */

gen int state=.

if `year'==1991 {
replace state=hgdst60
replace state=. if hgdst60<=0
}
if 1994<=`year' & `year'<=2013 {
replace state=gestcen
replace state=. if gestcen<=0
}
if `year'==2014 {
replace state=gestcen if (1<=hrmonth & hrmonth<=3)
replace state=. if gestcen<=0
replace state=11 if gestfips==23 & (4<=hrmonth & hrmonth<=12)
replace state=12 if gestfips==33 & (4<=hrmonth & hrmonth<=12)
replace state=13 if gestfips==50 & (4<=hrmonth & hrmonth<=12)
replace state=14 if gestfips==25 & (4<=hrmonth & hrmonth<=12)
replace state=15 if gestfips==44 & (4<=hrmonth & hrmonth<=12)
replace state=16 if gestfips==9 & (4<=hrmonth & hrmonth<=12)
replace state=21 if gestfips==36 & (4<=hrmonth & hrmonth<=12)
replace state=22 if gestfips==34 & (4<=hrmonth & hrmonth<=12)
replace state=23 if gestfips==42 & (4<=hrmonth & hrmonth<=12)
replace state=31 if gestfips==39 & (4<=hrmonth & hrmonth<=12)
replace state=32 if gestfips==18 & (4<=hrmonth & hrmonth<=12)
replace state=33 if gestfips==17 & (4<=hrmonth & hrmonth<=12)
replace state=34 if gestfips==26 & (4<=hrmonth & hrmonth<=12)
replace state=35 if gestfips==55 & (4<=hrmonth & hrmonth<=12)
replace state=41 if gestfips==27 & (4<=hrmonth & hrmonth<=12)
replace state=42 if gestfips==19 & (4<=hrmonth & hrmonth<=12)
replace state=43 if gestfips==29 & (4<=hrmonth & hrmonth<=12)
replace state=44 if gestfips==38 & (4<=hrmonth & hrmonth<=12)
replace state=45 if gestfips==46 & (4<=hrmonth & hrmonth<=12)
replace state=46 if gestfips==31 & (4<=hrmonth & hrmonth<=12)
replace state=47 if gestfips==20 & (4<=hrmonth & hrmonth<=12)
replace state=51 if gestfips==10 & (4<=hrmonth & hrmonth<=12)
replace state=52 if gestfips==24 & (4<=hrmonth & hrmonth<=12)
replace state=53 if gestfips==11 & (4<=hrmonth & hrmonth<=12)
replace state=54 if gestfips==51 & (4<=hrmonth & hrmonth<=12)
replace state=55 if gestfips==54 & (4<=hrmonth & hrmonth<=12)
replace state=56 if gestfips==37 & (4<=hrmonth & hrmonth<=12)
replace state=57 if gestfips==45 & (4<=hrmonth & hrmonth<=12)
replace state=58 if gestfips==13 & (4<=hrmonth & hrmonth<=12)
replace state=59 if gestfips==12 & (4<=hrmonth & hrmonth<=12)
replace state=61 if gestfips==21 & (4<=hrmonth & hrmonth<=12)
replace state=62 if gestfips==47 & (4<=hrmonth & hrmonth<=12)
replace state=63 if gestfips==1 & (4<=hrmonth & hrmonth<=12)
replace state=64 if gestfips==28 & (4<=hrmonth & hrmonth<=12)
replace state=71 if gestfips==5 & (4<=hrmonth & hrmonth<=12)
replace state=72 if gestfips==22 & (4<=hrmonth & hrmonth<=12)
replace state=73 if gestfips==40 & (4<=hrmonth & hrmonth<=12)
replace state=74 if gestfips==48 & (4<=hrmonth & hrmonth<=12)
replace state=81 if gestfips==30 & (4<=hrmonth & hrmonth<=12)
replace state=82 if gestfips==16 & (4<=hrmonth & hrmonth<=12)
replace state=83 if gestfips==56 & (4<=hrmonth & hrmonth<=12)
replace state=84 if gestfips==8 & (4<=hrmonth & hrmonth<=12)
replace state=85 if gestfips==35 & (4<=hrmonth & hrmonth<=12)
replace state=86 if gestfips==4 & (4<=hrmonth & hrmonth<=12)
replace state=87 if gestfips==49 & (4<=hrmonth & hrmonth<=12)
replace state=88 if gestfips==32 & (4<=hrmonth & hrmonth<=12)
replace state=91 if gestfips==53 & (4<=hrmonth & hrmonth<=12)
replace state=92 if gestfips==41 & (4<=hrmonth & hrmonth<=12)
replace state=93 if gestfips==6 & (4<=hrmonth & hrmonth<=12)
replace state=94 if gestfips==2 & (4<=hrmonth & hrmonth<=12)
replace state=95 if gestfips==15 & (4<=hrmonth & hrmonth<=12)
}
if 2015<=`year' & `year'<=2020 {
replace state=11 if gestfips==23 
replace state=12 if gestfips==33 
replace state=13 if gestfips==50 
replace state=14 if gestfips==25 
replace state=15 if gestfips==44 
replace state=16 if gestfips==9 
replace state=21 if gestfips==36 
replace state=22 if gestfips==34 
replace state=23 if gestfips==42 
replace state=31 if gestfips==39 
replace state=32 if gestfips==18 
replace state=33 if gestfips==17 
replace state=34 if gestfips==26 
replace state=35 if gestfips==55 
replace state=41 if gestfips==27 
replace state=42 if gestfips==19 
replace state=43 if gestfips==29 
replace state=44 if gestfips==38 
replace state=45 if gestfips==46 
replace state=46 if gestfips==31 
replace state=47 if gestfips==20 
replace state=51 if gestfips==10 
replace state=52 if gestfips==24 
replace state=53 if gestfips==11 
replace state=54 if gestfips==51 
replace state=55 if gestfips==54 
replace state=56 if gestfips==37 
replace state=57 if gestfips==45 
replace state=58 if gestfips==13 
replace state=59 if gestfips==12 
replace state=61 if gestfips==21 
replace state=62 if gestfips==47 
replace state=63 if gestfips==1 
replace state=64 if gestfips==28 
replace state=71 if gestfips==5 
replace state=72 if gestfips==22 
replace state=73 if gestfips==40 
replace state=74 if gestfips==48 
replace state=81 if gestfips==30 
replace state=82 if gestfips==16 
replace state=83 if gestfips==56 
replace state=84 if gestfips==8 
replace state=85 if gestfips==35 
replace state=86 if gestfips==4 
replace state=87 if gestfips==49 
replace state=88 if gestfips==32 
replace state=91 if gestfips==53 
replace state=92 if gestfips==41 
replace state=93 if gestfips==6 
replace state=94 if gestfips==2 
replace state=95 if gestfips==15 
}
lab var state "State"
#delimit ;
lab def state
11 "Maine"
12 "New Hampshire"
13 "Vermont"
14 "Massachusetts"
15 "Rhode Island"
16 "Connecticut"
21 "New York"
22 "New Jersey"
23 "Pennsylvania"
31 "Ohio"
32 "Indiana"
33 "Illinois"
34 "Michigan"
35 "Wisconsin"
41 "Minnesota"
42 "Iowa"
43 "Missouri"
44 "North Dakota"
45 "South Dakota"
46 "Nebraska"
47 "Kansas"
51 "Delaware"
52 "Maryland"
53 "District of Columbia"
54 "Virginia"
55 "West Virginia"
56 "North Carolina"
57 "South Carolina"
58 "Georgia"
59 "Florida"
61 "Kentucky"
62 "Tennessee"
63 "Alabama"
64 "Mississippi"
71 "Arkansas"
72 "Louisiana"
73 "Oklahoma"
74 "Texas"
81 "Montana"
82 "Idaho"
83 "Wyoming"
84 "Colorado"
85 "New Mexico"
86 "Arizona"
87 "Utah"
88 "Nevada"
91 "Washington"
92 "Oregon"
93 "California"
94 "Alaska"
95 "Hawaii"
;
#delimit cr
lab val state state
notes state: hg-st60, gestcen

/* Metropolitan area */

gen byte metro=.

if `year'==1991 {
replace metro=0 if hdmetsta==2
replace metro=1 if hdmetsta==1
}
if 1994<=`year' & `year'<=2003 {
replace metro=0 if gemetsta==2
replace metro=1 if gemetsta==1
}
if `year'==2004 {
replace metro=0 if gemetsta==2 & (1<=month & month<=4)
replace metro=1 if gemetsta==1 & (1<=month & month<=4)
replace metro=0 if gtmetsta==2 & (5<=month & month<=12)
replace metro=1 if gtmetsta==1 & (5<=month & month<=12)
}
if 2005<=`year' & `year'<=2020 { 
replace metro=0 if gtmetsta==2
replace metro=1 if gtmetsta==1
}
lab var metro "Metropolitan area"
notes metro: CPS: h-metsta, gemetsta, gtmetsta
notes metro: unavailable June-August 1995



/* Central city */

gen byte centcity=.

if `year'==1991 {
replace centcity=0 if 1<=hgdmsas & hgdmsas<=3
replace centcity=1 if hgdmsas==1
}
if `year'==1994 {
replace centcity=0 if gemsast~=.
replace centcity=1 if gemsast==1
}
if `year'==1995 {
* not available
}
if 1996<=`year' & `year'<=2003 {
capture rename gtmsast gemsast
replace centcity=0 if gemsast~=.
replace centcity=1 if gemsast==1
}
if `year'==2004 {
replace centcity=0 if gemsast~=. & (1<=month & month<=4)
replace centcity=1 if gemsast==1 & (1<=month & month<=4)
replace centcity=0 if gtcbsast~=. & (5<=month & month<=12)
replace centcity=1 if gtcbsast==1 & (5<=month & month<=12)
}
if 2005<=`year' & `year'<=2020 { 
replace centcity=0 if gtcbsast~=. 
replace centcity=1 if gtcbsast==1
}
lab var centcity "Central city"
notes centcity: BLS considers all 1995 data on SMSAs suspect
notes centcity: CPS: derived from hg-msas, gemsast, gtmsast, gtcbsast
notes centcity: not available June-August 1995

/* Suburb */

gen byte suburb=.

if `year'==1991 {
replace suburb=0 if 1<=hgdmsas & hgdmsas<=3
replace suburb=1 if hgdmsas==2
}
if `year'==1994 {
replace suburb=0 if gemsast~=.
replace suburb=1 if gemsast==2
}
if `year'==1995 {
* not available
}
if 1996<=`year' & `year'<=2003 {
replace suburb=0 if gemsast~=.
replace suburb=1 if gemsast==2
}
if `year'==2004 {
replace suburb=0 if gemsast~=. & (1<=month & month<=4)
replace suburb=1 if gemsast==2 & (1<=month & month<=4)
replace suburb=0 if gtcbsast~=. & (5<=month & month<=12)
replace suburb=1 if gtcbsast==2 & (5<=month & month<=12)
}
if 2005<=`year' & `year'<=2020 { 
replace suburb=0 if gtcbsast~=. 
replace suburb=1 if gtcbsast==2
}
lab var suburb "Suburbs"
notes suburb: BLS considers all 1995 data on SMSAs suspect
notes suburb: CPS: derived from hg-msas, gemsast, gtmsast, gtcbsast
notes suburb: not available June-August 1995

/* Rural */

gen byte rural=.

if `year'==1991 {
replace rural=0 if 1<=hgdmsas & hgdmsas<=3
replace rural=1 if hgdmsas==3
}
if `year'==1994 {
replace rural=0 if gemsast~=.
replace rural=1 if gemsast==3
}
if `year'==1995 {
* not available
}
if 1996<=`year' & `year'<=2003 {
replace rural=0 if gemsast~=.
replace rural=1 if gemsast==3
}
if `year'==2004 {
replace rural=0 if gemsast~=. & (1<=month & month<=4)
replace rural=1 if gemsast==3 & (1<=month & month<=4)
replace rural=0 if gtcbsast~=. & (5<=month & month<=12)
replace rural=1 if gtcbsast==3 & (5<=month & month<=12)
}
if 2005<=`year' & `year'<=2020 { 
replace rural=0 if gtcbsast~=. 
replace rural=1 if gtcbsast==3
}
lab var rural "Rural"
notes rural: BLS considers all 1995 data on SMSAs suspect
notes rural: CPS: derived from hg-msas, gemsast, gtmsast
notes rural: not available June-August 1995

/* City codes */

/* 
city-related variables are included, but not yet documented 
or supported; note that NBER reports that BLS warns that all 
SMSA coding for 1995 is suspect 

city-related codes included here in this format only to provide
compatibility with CEPR ORG retrievals; code for variables
before 2003 is not necessarily valid: check before using

city codes were changed substantially in May 2004; coding below
makes no attempt to correct for these coding changes

*/


	/* smsastat */

gen smsastat=.
gen smsa70=.
gen smsa80=.
gen smsa93=.
gen smsarank=.
gen cmsarank=.
gen pmsarank=.
gen icntcity=.
gen msafips=.
gen cmsacode05=.
gen cmsacode14=.
gen fipscounty=.
gen principalcty=.

/* Individual Principal City */

/* 
FOR 1994-April 2004 NOTE:  WHENEVER POSSIBLE THIS CODE 
IDENTIFIES SPECIFIC CENTRAL CITIES IN
AN MSA/PMSA THAT HAVE MULTIPLE 
CENTRAL CITIES.  THIS CODE MUST BE 
USED IN COMBINATION WITH THE MSA/PMSA 
FIPS CODE (GEMSA) IN ORDER TO 
UNIQUELY IDENTIFY A SPECIFIC CITY

FOR MAY 2004-ON NOTE: WHENEVER POSSIBLE THIS CODE
IDENTIFIES SPECIFIC PRINCIPAL CITIES IN
A METROPOLITAN AREA THAT HAS MULTIPLE
PRINCIPAL CITIES. THIS CODE MUST BE
USED IN COMBINATION WITH THE CBSA
FIPS CODE (GTCBSA) IN ORDER TO
UNIQUELY IDENTIFY A SPECIFIC CITY
*/

if 1994==`year' {
replace principalcty=geindvcc
}
if 1995==`year' {
* not available
}
if 1996==`year' & `year'<=2003 {
replace principalcty=geindvcc
}
if 2004==`year' {
replace principalcty=geindvcc if (1<=month & month<=4)
replace principalcty=gtindvpc if (5<=month & month<=12)
}

if 2005<=`year' & `year'<=2020 {
replace principalcty=gtindvpc
}
lab var principalcty "Individual Principal City"
notes principalcty: Census: geindvcc gtindvpc
notes principalcty: BLS considers all 1995 data on SMSAs suspect
notes principalcty: Must combine with cbsa code (gtcbsa) to uniquely /*
*/ identify principal cities
notes principalcty: not available June-August 1995
notes principalcty: CPS: geindvcc, gtindvpc


/* FIPS County Code */

/* FIPS codes can include leading zero characters, and should
 generally be treated as TEXT fields, not numbers. 

Please note that these county codes must be used in conjunction with 
state codes to create unique county identifiers as county codes 
start with 001 in each state

*/

if 1995<=`year' & `year'<=2003 {
replace fipscounty=geco
}

if `year'==2004 {
replace fipscounty=geco if (1<=month & month<=4)
replace fipscounty=gtco if (5<=month & month<=12)
}


if 2005<=`year' & `year'<=2020 {
replace fipscounty=gtco
}

/* County Code Defintion, by State 
Alabama
003 Baldwin*
015 Calhoun
073 Jefferson
081 Lee
089 Madison
097 Mobile
117 Shelby
125 Tuscaloosa

Alaska
020 Anchorage

Arizona
003 Cochise*
013 Maricopa
015 Mohave*
019 Pima
021 Pinal
025 Yavapai
027 Yuma

Arkansas
119 Pulaski

California
001 Alameda
007 Butte
013 Contra Costa
017 El Dorado
019 Fresno
025 Imperial
029 Kern
037 Los Angeles
039 Madera
041 Marin
047 Merced
053 Monterey
055 Napa
059 Orange
061 Placer
065 Riverside
067 Sacramento
071 San Bernardino
073 San Diego
075 San Francisco
077 San Joaquin
079 San Luis Obispo
081 San Mateo
083 Santa Barbara
085 Santa Clara
087 Santa Cruz
089 Shasta
095 Solano
097 Sonoma
099 Stanislaus
107 Tulare
111 Ventura
113 Yolo

Colorado
005 Arapahoe
013 Boulder
031 Denver
035 Douglas
041 El Paso
059 Jefferson
069 Larimer
101 Pueblo
123 Weld

Connecticut
001 Fairfield
005 Litchfield*
009 New Haven
011 New London
015 Windham


Delaware
001 Kent
003 New Castle
005 Sussex*

District of Columbia
001 District of Columbia

Florida
001 Alachua
005 Bay
009 Brevard
011 Broward
015 Charlotte
019 Clay
021 Collier
025 Dade
033 Escambia
053 Hernando
057 Hillsborough
061 Indian River
069 Lake
071 Lee
081 Manatee
083 Marion
085 Martin
086 Miami-Dade
091 Okaloosa
095 Orange
097 Osceola
099 Palm Beach
101 Pasco
103 Pinellas
105 Polk
109 St. Johns
111 St. Lucie
113 Santa Rosa
115 Sarasota
117 Seminole
127 Volusia

Georgia
015 Bartow
045 Carroll
057 Cherokee
063 Clayton
067 Cobb
077 Coweta
089 Dekalb
097 Douglas
113 Fayette
117 Forsythe
121 Fulton
135 Gwinnett
139 Hall
151 Henry
153 Houston
223 Paulding

Hawaii
001 Hawaii*
003 Honolulu

Idaho
055 Kootenai

Illinois
091 Kankakee
097 Lake
099 LaSalle
111 McHenry
113 McLean
115 Macon
119 Madison
163 St. Clair
179 Tazewell

Indiana
019 Clark
039 Elkhart
057 Hamilton
063 Hendricks
081 Johnson
085 Kosciusko
089 Lake
091 LaPorte
095 Madison
105 Monroe
127 Porter
141 St. Joseph
157 Tippecanoe

Iowa
013 Black Hawk
103 Johnson
113 Linn
153 Polk
163 Scott

Kansas
045 Douglas
091 Johnson
173 Sedgwick
177 Shawnee

Kentucky
015 Boone
067 Fayette
111 Jefferson
117 Kenton

Louisiana
005 Ascension
019 Calcasieu
033 East Baton Rouge
051 Jefferson
063 Livingston
071 Orleans
073 Ouachita
103 St. Tammany

Maine
001 Androscoggin
005 Cumberland
011 Kennebec*
019 Penobscot

Maryland
003 Anne Arundel
005 Baltimore
013 Carroll
015 Cecil
017 Charles
021 Frederick
025 Harford
027 Howard
031 Montgomery
033 Prince Georges
037 St. Mary's
043 Washington
510 Baltimore City

Massachusetts
001 Barnstable
005 Bristol
009 Essex
013 Hampden
015 Hampshire
017 Middlesex
021 Norfolk
023 Plymouth
025 Suffolk
027 Worcester


Michigan
005 Allegan*
021 Berrien
025 Calhoun
049 Genesee
075 Jackson
081 Kent
093 Livingston
099 Macomb
115 Monroe
121 Muskegon
125 Oakland
139 Ottawa
145 Saginaw
147 St. Clair
161 Washtenaw
163 Wayne

Minnesota
003 Anoka
037 Dakota
053 Hennepin
123 Ramsey
137 St. Louis
139 Scott
163 Washington
171 Wright

Missouri
003 Clay
019 Boone
037 Jackson
071 Franklin
099 Jefferson
189 St. Louis

Montana
111 Yellowstone

Nebraska
055 Douglas
109 Lancaster
153 Sarpy

Nevada
003 Clark
031 Washoe

New Hampshire
011 Hillsborough
013 Merrimack*
015 Rockingham
017 Strafford

New Jersey
001 Atlantic
003 Bergen
005 Burlington
007 Camden
009 Cape May
011 Cumberland
013 Essex
017 Hudson
019 Hunterdon
021 Mercer
023 Middlesex
025 Monmouth
027 Morris
029 Ocean
031 Passaic
035 Somerset
037 Sussex
039 Union
041 Warren

New Mexico
001 Bernalillo
013 Dona Ana
045 San Juan
049 Santa Fe

New York
005 Bronx
013 Chautauqua*
027 Dutchess
047 Kings
055 Monroe
059 Nassau
061 New York
067 Onondaga
069 Ontario
071 Orange
075 Oswego
081 Queens
085 Richmond
087 Rockland
089 St. Lawrence
091 Saratoga
103 Suffolk
111 Ulster
119 Westchester

North Carolina
001 Alamance
021 Buncombe
051 Cumberland
057 Davidson*
067 Forsyth
097 Iredell*
119 Mecklenburg
129 New Hanover
133 Onslow
147 Pitt
155 Robeson*
159 Rowan
179 Union
183 Wake
191 Wayne

North Dakota
017 Cass

Ohio
017 Cass
023 Clark
025 Clermont
029 Columbiana*
035 Cuyahoga
041 Delaware
045 Fairfield
049 Franklin
057 Greene
061 Hamilton
085 Lake
089 Licking
093 Lorain
095 Lucas
103 Medina
109 Miami
113 Montgomery
133 Portage
153 Summit
165 Warren
169 Wayne*

Oklahoma
031 Comanche
143 Tulsa

Oregon
017 Deschutes
029 Jackson
039 Lane
043 Linn*

Pennsylvania
003 Allegheny
007 Beaver
011 Berks
013 Blair
017 Bucks
019 Butler
021 Cambria
029 Chester
043 Dauphin
045 Delaware
049 Erie
051 Fayette
055 Franklin*
071 Lancaster
081 Lycoming
085 Mercer
089 Monroe*
091 Montgomery
101 Philadelphia
107 Schuylkill*
125 Washington
129 Westmoreland
133 York

South Carolina
007 Anderson
041 Florence
045 Greenville
051 Horry
063 Lexington
079 Richland
083 Spartanburg
091 York

South Dakota
099 Minnehaha

Tennessee
009 Blount
093 Knox
125 Montgomery
165 Sumner
187 Williamson
189 Wilson

Texas
029 Bexar
039 Brazoria
041 Brazos
061 Cameron
135 Ector
139 Ellis
141 El Paso
157 Fort Bend
167 Galveston
181 Grayson
183 Gregg
215 Hidalgo
251 Johnson
303 Lubbock
309 McLennan
329 Midland
375 Potter
381 Randall
423 Smith
439 Tarrant
441 Taylor
479 Webb
485 Wichita

Utah
049 Utah
053 Washington

Virginia
013 Arlington
041 Chesterfield
059 Fairfax
087 Henrico
107 Loudoun
153 Prince William
177 Spotsylvania
179 Stafford
510 Alexandria City
550 Chesapeake City
650 Hampton City
700 Newport News City
710 Norfolk City
740 Portsmouth City
760 Richmond City
810 Virginia Beach City  

Washington
011 Clark
033 King
035 Kitsap
053 Pierce
057 Skagit
061 Snohomish
063 Spokane
067 Thurston
073 Whatcom
077 Yakima

West Virginia
039 Kanawha

Wisconsin
009 Brown
025 Dane
059 Kenosha
063 La Crosse
073 Marathon
101 Racine
105 Rock
139 Winnebago

* Counties marked with an asterisk (*) are also single 
county Micropolitan Statistical Areas. They are not 
otherwise identified on the files.       

*/

lab var fipscounty "FIPS County Code"
notes fipscounty: Use with state code to create unique county
notes fipscounty: Available 1995:9 -on
notes fipscounty: CPS: gtco, geco



/* Metropolitan CBSA FIPS Code */

gen smsastat05=.
gen smsastat14=.

if 1994<=`year' & `year'<=2003 {
*replace smsastat=hg_msac
}

if 2005<=`year' & `year'<=2013 {
replace smsastat05=gtcbsa
}

if `year'==2014 {
    replace smsastat05=gtcbsa if (1<=month & month<=4)
    replace smsastat14=gtcbsa if (5<=month & month<=12)
}
if 2015<=`year' & `year'<=2020 {
replace smsastat14=gtcbsa
}

#delimit ;
lab define smsastat05
10420 "Akron, OH"
10500 "Albany, GA (Baker, Terrell, and Worth Counties not in sample)"     
10580 "Albany-Schenectady-Troy, NY"
10740 "Albuquerque, NM"
10900 "Allentown-Bethlehem-Easton, PA-NJ"
11020 "Altoona, PA"
11100 "Amarillo, TX (Armstrong and Carson Counties not in sample)"
11300 "Anderson, IN"
11340 "Anderson, SC"
11460 "Ann Arbor, MI"
11500 "Anniston-Oxford, AL"
11540 "Appleton, WI"
11700 "Asheville, NC (Haywood and Madison Counties not in sample)"
12020 "Athens-Clarke County, GA (Oglethorpe County not in sample)"
12060 "Atlanta-Sandy Springs-Marietta, GA (Haralson, Heard, Jasper,Meriwether and Spalding Counties not in sample)"
12100 "Atlantic City, NJ"
12260 "Augusta-Richmond County, GA-SC"
12420 "Austin-Round Rock, TX"
12540 "Bakersfield, CA"
12580 "Baltimore-Towson, MD"
12940 "Baton Rouge, LA"
13140 "Beaumont-Port Arthur, TX"
13380 "Bellingham, WA"
13460 "Bend, OR"
13740 "Billings, MT (Carbon County not in sample)"
13780 "Binghamton, NY"
13820 "Birmingham-Hoover, AL"
14020 "Bloomington, IN (Owen County in sample)"
14060 "Bloomington-Normal, IL"
14260 "Boise City-Nampa, ID (Owyhee County not in sample)"
14500 "Boulder, CO"
14540 "Bowling Green, KY"
14740 "Bremerton-Silverdale, WA"
15180 "Brownsville-Harlingen, TX"
15380 "Buffalo-Niagara Falls, NY"
15940 "Canton-Massillon, OH"
15980 "Cape Coral-Fort Myers,FL"
16300 "Cedar Rapids, IA (Benton and Jones Counties not in sample)"
16580 "Champaign-Urbana, IL (Ford County not in sample)"
16620 "Charleston, WV (Clay County not in sample)"
16700 "Charleston-North Charleston, SC"
16740 "Charlotte-Gastonia-Concord, NC-SC (Anson County, NC not in sample)"  
16860 "Chattanooga, TN-GA"
16980 "Chicago-Naperville-Joliet, IL-IN-WI (DeKalb, IL; Jasper, IN; and Kenosha, WI Counties not in sample)"
17020 "Chico, CA"
17140 "Cincinnati-Middletown, OH-KY-IN (Franklin County , IN not in sample; Dearborn and Ohio Counties, IN not identified)"
17460 "Cleveland-Elyria-Mentor, OH"
17660 "Coeur d'Alene, ID"
17820 "Colorado Springs, CO"
17860 "Columbia, MO (Howard County not in sample)"
17900 "Columbia, SC"
17980 "Columbus, GA-AL (Harris County, GA and Russell County, Alabama not in sample)"
18140 "Columbus, OH (Morrow County not in sample)"
18580 "Corpus Christi, TX"
19100 "Dallas-Fort Worth-Arlington, TX (Delta and Hunt Counties not in sample)"
19340 "Davenport-Moline-Rock Island, IA-IL"
19380 "Dayton, OH"
19460 "Decatur, Al"
19500 "Decatur, IL"
19660 "Deltona-Daytona Beach-Ormond Beach, FL"
19740 "Denver-Aurora, CO"
19780 "Des Moines, IA"
19820 "Detroit-Warren-Livonia,MI"
20100 "Dover, DE"
20260 "Duluth, MN-WI (Carlton County, MN not in sample, WI portion not identified)"
20500 "Durham, NC"
20740 "Eau Claire, WI"
20940 "El Centro, CA"
21340 "El Paso, TX"
21500 "Erie, PA"
21660 "Eugene-Springfield, OR"
21780 "Evansville, IN-KY (Gibson County, IN and Kentucky portion not in sample)"
22020 "Fargo, ND-MN (MN portion not identified)"
22140 "Farmington, NM"
22180 "Fayetteville, NC"
22220 "Fayetteville-Springdale-Rogers, AR-MO (Madison County, AR and Missouri portion not in sample)"
22420 "Flint, MI"
22460 "Florence, AL"
22660 "Fort Collins-Loveland, CO"
22900 "Fort Smith, AR-OK (Oklahoma portion not in sample)"
23020 "Fort Walton Beach-Crestview-Destin, FL"
23060 "Fort Wayne, IN"
23420 "Fresno, CA"
23540 "Gainesville, FL (Gilchrist County not in sample)"
24340 "Grand Rapids-Wyoming, MI"
24540 "Greeley, CO"
24580 "Green Bay, WI (Oconto County not in sample)"
24660 "Greensboro-High Point, NC"
24860 "Greenville, SC (Laurens and Pickens Counties not in sample)"
25060 "Gulfport-Biloxi, MS (Stone County not in sample)"
25180 "Hagerstown-Martinsburg, MD-WV (Berkeley County, WV not identified and Morgan County, WV not in sample)"
25420 "Harrisburg-Carlisle, PA"
25500 "Harrisonburg, VA"
25860 "Hickory-Morganton-Lenoir, NC (Caldwell County not in sample)"
26100 "Holland-Grand Haven, MI"
26180 "Honolulu, HI"
26420 "Houston-Baytown-Sugar Land, TX"
26580 "Huntington-Ashland, WV-KY-OH (Kentucky and Ohio portions not identified)"
26620 "Huntsville, AL"
26900 "Indianapolis, IN"
26980 "Iowa City, IA (Washington County not in sample)"
27100 "Jackson, MI"
27140 "Jackson, MS"
27260 "Jacksonville, FL"
27340 "Jacksonville, NC"
27500 "Janesville, WI"
27740 "Johnson City, TN"
27780 "Johnstown, PA"
27900 "Joplin, MO"
28020 "Kalamazoo-Portage, MI"
28100 "Kankakee-Bradley, IL"
28140 "Kansas City, MO-KS (Franklin, KS; Leavenworth, KS; Linn, KS; Bates,MO; and Caldwell, MO Counties not in sample)"
28660 "Killeen-Temple-Fort Hood, TX" 
28700 "Kingsport-Bristol, TN-VA (Virginia portion not identified)"
28740 "Kingston, NY"
28940 "Knoxville, TN (Anderson County not in sample)"
29100 "La Crosse, WI-MN (Houston County not in sample)"
29180 "Lafayette, LA"
29340 "Lake Charles, LA (Cameron Parish not in sample)"
29460 "Lakeland-Winter Haven, FL"
29540 "Lancaster, PA"
29620 "Lansing-East Lansing, MI"
29700 "Laredo, TX"
29740 "Las Cruces, NM"
29820 "Las Vegas-Paradise, NV"
29940 "Lawrence, KS"
30020 "Lawton, OK"
30460 "Lexington-Fayette, KY"
30780 "Little Rock-North Little Rock, AR (Perry County not in sample)"
30980 "Longview, TX (Rusk and Upshur Counties not in sample)"
31100 "Los Angeles-Long Beach-Santa Ana, CA"
31140 "Louisville, KY-IN (Washington, IN; Henry, KY; Nelson, KY; Shelby,KY; and Trimble, KY Counties not in sample)"
31180 "Lubbock, TX (Crosby County not in sample)"        
31340 "Lynchburg, VA (Appomattox and Bedford Counties and Bedford City not in sample)"
31420 "Macon, GA (Crawford, Monroe, and Twiggs Counties not in sample)"
31460 "Madera, CA"
31540 "Madison, WI (Iowa County not in sample)"
32580 "McAllen-Edinburg-Pharr, TX"
32780 "Medford, OR"
32820 "Memphis, TN-MS-AR (Arkansas portion not identified and Tunica County, MS not in sample)"
32900 "Merced, CA"
33100 "Miami-Fort Lauderdale-Miami Beach, FL"
33140 "Michigan City-La Porte, IN"
33260 "Midland, TX"
33340 "Milwaukee-Waukesha-West Allis, WI"
33460 "Minneapolis-St Paul-Bloomington, MN-WI (Wisconsin portion not identified)"
33660 "Mobile, AL"
33700 "Modesto, CA"
33740 "Monroe, LA"
33780 "Monroe, MI"
33860 "Montgomery, AL"
34740 "Muskegon-Norton Shores, MI"
34820 "Myrtle Beach-Conway-North Myrtle Beach, SC"
34900 "Napa, CA"
34940 "Naples-Marco Island, FL"
34980 "Nashville-Davidson-Murfreesboro, TN (Cannon, Hickman and Macon Counties not in sample)"
35380 "New Orleans-Metairie-Kenner, LA"
35620 "New York-Northern New Jersey-Long Island, NY-NJ-PA (Pennsylvania portion not in sample. White Plains central city recoded to balance of metropolitan)"
35660 "Niles-Brenton Harbor, MI"
36100 "Ocala, FL"
36140 "Ocean City, NJ"
36260 "Ogden-Clearfield, UT"
36420 "Oklahoma City, OK"
36500 "Olympia, WA"
36540 "Omaha-Council Bluffs, NE-IA"
36740 "Orlando, FL"
36780 "Oshkosh-Neenah, WI"
37100 "Oxnard-Thousand Oaks-Ventura, CA"
37340 "Palm Bay-Melbourne-Titusville, FL"
37460 "Panama City-Lynn Haven, FL"
37860 "Pensacola-Ferry Pass-Brent, FL"
37900 "Peoria, IL"
37980 "Philadelphia-Camden-Wilmington, PA-NJ-DE"
38060 "Phoenix-Mesa-Scottsdale, AZ"
38300 "Pittsburgh, PA"
38900 "Portland-Vancouver-Beaverton, OR-WA (Yamhill County, OR not in sample)"
38940 "Port St. Lucie-Fort Pierce, FL"
39100 "Puoghkeepsie-Newburgh-Middletown, NY"
39140 "Prescott, AZ"
39340 "Provo-Orem, UT (Juab County not in sample)"
39380 "Pueblo, CO"
39460 "Punta Gorda, FL"
39540 "Racine, WI"
39580 "Raleigh-Cary, NC"
39740 "Reading, PA"
39900 "Reno-Sparks, NV"
40060 "Richmond, VA (Cumberland County not in sample)"
40140 "Riverside-San Bernardino-Ontario, CA"
40220 "Roanoke, VA (Craig and Franklin Counties not in sample)"
40380 "Rochester, NY"
40420 "Rockford, IL"
40900 "Sacramento-Arden-Arcade-Roseville, CA"
40980 "Saginaw-Saginaw Township North, MI"
41060 "St. Cloud, MN"
41180 "St. Louis, MO-IL (Calhoun County, IL not in sample)"
41420 "Salem, OR"
41500 "Salinas, CA"
41540 "Salisbury, MD"
41620 "Salt Lake City, UT (Tooele County not in sample)"
41700 "San Antonio TX"
41740 "San Diego-Carlsbad-San Marcos, CA"
41860 "San Francisco-Oakland-Freemone, CA"
41940 "San Jose-Sunnyvale-Santa Clara, CA"
42020 "San Luis Obispo-Paso Robles, CA"
42060 "Santa Barbara-Santa Maria-Goleta, CA"
42100 "Santa Cruz-Watsonville, CA"
42140 "Santa Fe, NM"
42220 "Santa Rose-Petaluma, CA"
42260 "Sarasota-Bradenton-Venice, FL"
42340 "Savannah, GA"
42540 "Scranton-Wilkes-Barre, PA"
42660 "Seattle-Tacoma-Bellevue, WA"
43340 "Shreveport-Bossier City, LA"
43620 "Sioux Falls, SD"
43780 "South Bend-Mishawaka, IN-MI (Michigan portion not identified)"
43900 "Spartanburg, SC"
44060 "Spokane, WA"
44100 "Springfield, IL"
44180 "Springfield, MO (Dallas and Polk Counties not in sample)"
44220 "Springfield, OH"
44700 "Stockton, CA"
45060 "Syracuse, NY"
45220 "Tallahassee, FL"
45300 "Tampa-St. Petersburg-Clearwater, FL"
45780 "Toledo, OH (Ottawa County not in sample)"       
45820 "Topeka, KS (Jackson and Jefferson Counties not in sample)" 
45940 "Trenton-Ewing, NJ"
46060 "Tucson, AZ"
46140 "Tulsa, OK (Okmulgee County not in sample)"
46220 "Tuscaloosa, AL (Greene and Hale Counties not in sample)"
46540 "Utica-Rome, NY"
46660 "Valdosta, GA (Lanier County not in sample)"
46700 "Vallejo-Fairfield, CA"
46940 "Vero Beach, FL"
47020 "Victoria, TX"
47220 "Vineland-Millville-Bridgeton, NJ"
47260 "Virginia Beach-Norfolk-Newport News, VA-NC (North Carolina portion not identified)"
47300 "Visalia-Porterville, CA"
47380 "Waco, TX"
47580 "Warner Robins, GA"
47900 "Washington-Arlington-Alexandria, DC-VA-MD-WV (West Virginia portion not identified. Reston central city recoded to balance of metropolitan.)"
47940 "Waterloo-Cedar Falls, IA (Grundy County not in sample)"       
48140 "Wausau, WI"
48620 "Wichita, KS"
49180 "Winston-Salem, NC"
49420 "Yakima, WA"
49620 "York-Hanover, PA"
49660 "Youngstown-Warren-Boardman, OH-PA (Pennsylvania portion not in sample)"
70750 "Bangor, ME"
70900 "Barnstable Town, MA"
71650 "Boston-Cambridge-Quincy, MA-NH"
71950 "Bridgeport-Stamford-Norwalk, CT"
72400 "Burlington-South Burlington, VT"
72850 "Danbury, CT"
73450 "Hartford-West Hartford-East Hartford, CT"
74500 "Leominster-Fitchburg-Gardner, MA"
75700 "New Haven, CT"
76450 "Norwich-New London, CT-RI (RI portion recoded to Providence NECTA)"
76750 "Portland-South Portland, ME"
77200 "Providence-Fall River-Warwick, RI-MA"
77350 "Rochester-Dover, NH-ME (Maine portion not identified)"
78100 "Springfield, MA-CT (Connecticut portion not identified)"
78700 "Waterbury, CT"
79600 "Worcester, MA-CT (Connecticut portion not identified)"
;
#delimit cr

lab val smsastat05 smsastat05
lab var smsastat05 "Metro CBSA FIPS Code"
notes smsastat05: CPS: h-metsta gemetsta gtcbsa
notes smsastat05: Available 2005-April 2014


#delimit ;
lab define smsastat14
10180 "Abilene, TX"
10420 "Akron, OH"
10500 "Albany, GA"
10580 "Albany-Schenectady-Troy, NY"
10740 "Albuquerque, NM"
10900 "Allentown-Bethlehem-Easton, PA-NJ"
11020 "Altoona, PA"
11100 "Amarillo, TX"
11300 "Anderson, IN*"
11340 "Anderson, SC*"
11460 "Ann Arbor, MI"
11500 "Anniston-Oxford-Jacksonville, AL"
11540 "Appleton, WI"
11700 "Asheville, NC"
12020 "Athens-Clarke County, GA"
12060 "Atlanta-Sandy Springs-Roswell, GA"
12100 "Atlantic City-Hammonton, NJ"
12220 "Auburn-Opelika, AL"
12260 "Augusta-Richmond County, GA-SC"
12420 "Austin-Round Rock, TX"
12540 "Bakersfield, CA"
12580 "Baltimore-Columbia-Towson, MD"
12620 "Bangor, ME"
12700 "Barnstable, MA"
12940 "Baton Rouge, LA"
12980 "Battle Creek, MI"
13140 "Beaumont-Port Arthur, TX"
13380 "Bellingham, WA*"
13460 "Bend-Redmond, OR"
13740 "Billings, MT"
13780 "Binghamton, NY"
13820 "Birmingham-Hoover, AL"
13980 "Blacksburg—Christiansburg-Radford, VA"
14010 "Bloomington, IL"
14020 "Bloomington, IN"
14060 "Bloomington-Normal, IL*"
14260 "Boise City, ID"
14460 "Boston-Cambridge-Newton, MA-NH"
14500 "Boulder, CO"
14540 "Bowling Green, KY"
14740 "Bremerton-Silverdale, WA*"
14860 "Bridgeport-Stamford-Norwalk, CT"
15180 "Brownsville-Harlingen, TX"
15380 "Buffalo-Cheektowaga-Niagara Falls, NY"
15500 "Burlington, NC"
15540 "Burlington-South Burlington, VT"
15680 "California-Lexington Park, MD"
15940 "Canton-Massillon, OH"
15980 "Cape Coral-Fort Myers, FL"
16060 "Carbondale-Marion, IL"
16300 "Cedar Rapids, IA"
16540 "Chambersburg-Waynesboro, PA"
16580 "Champaign-Urbana, IL"
16620 "Charleston, WV"
16700 "Charleston-North Charleston, SC"
16740 "Charlotte-Concord-Gastonia, NC-SC"
16820 "Charlottesville, VA"
16860 "Chattanooga, TN-GA"
16980 "Chicago-Naperville-Elgin, IL-IN-WI"
17020 "Chico, CA"
17140 "Cincinnati, OH-KY-IN"
17300 "Clarksville, TN-KY"
17420 "Cleveland, TN"
17460 "Cleveland-Elyria, OH"
17660 "Coeur d’Alene, ID"
17780 "College Station-Bryan, TX"
17820 "Colorado Springs, CO"
17860 "Columbia, MO"
17900 "Columbia, SC"
17980 "Columbus, GA-AL"
18140 "Columbus, OH"
18580 "Corpus Christi, TX"
19100 "Dallas-Fort Worth-Arlington, TX"
19300 "Daphne-Fairhope-Foley, AL"
19340 "Davenport-Moline-Rock Island, IA-IL"
19380 "Dayton, OH"
19460 "Decatur, Al"
19500 "Decatur, IL"
19660 "Deltona-Daytona Beach-Ormond Beach, FL"
19740 "Denver-Aurora-Lakewood, CO"
19780 "Des Moines-West Des Moines, IA"
19820 "Detroit-Warren-Dearborn, MI"
20100 "Dover, DE"
20260 "Duluth, MN-WI"
20500 "Durham-Chapel Hill, NC"
20700 "East Stroudsburg, PA"
20740 "Eau Claire, WI"
20940 "El Centro, CA"
21140 "Elkhart-Goshen, IN"
21340 "El Paso, TX"
21500 "Erie, PA"
21660 "Eugene, OR"
21780 "Evansville, IN-KY"
22020 "Fargo, ND-MN"
22140 "Farmington, NM"
22180 "Fayetteville, NC"
22220 "Fayetteville-Springdale-Rogers, AR-MO"
22420 "Flint, MI"
22500 "Florence, SC"
22520 "Florence-Muscle Shoals, AL"
22660 "Fort Collins, CO"
22900 "Fort Smith, AR-OK"
23020 "Fort Walton Beach-Crestview-Destin, FL*"
23060 "Fort Wayne, IN"
23420 "Fresno, CA"
23540 "Gainesville, FL"
23580 "Gainesville, GA"
24020 "Glen Falls, NY"
24140 "Goldsboro, NC"
24340 "Grand Rapids-Wyoming, MI"
24540 "Greeley, CO"
24580 "Green Bay, WI"
24660 "Greensboro-High Point, NC"
24780 "Greenville, NC"
24860 "Greenville, SC"
25060 "Gulfport-Biloxi, MS*"
25180 "Hagerstown-Martinsburg, MD-WV"
25260 "Hanford-Corcoran, CA"
25420 "Harrisburg-Carlisle, PA"
25500 "Harrisonburg, VA*"
25540 "Hartford-West Hartford-East Hartford, CT"
25860 "Hickory-Morganton-Lenoir, NC"
25940 "Hilton Head Island-Bluffton-Beaufort, SC"
26100 "Holland-Grand Haven, MI*"
26180 "Honolulu, HI*"
26420 "Houston-Baytown-Sugar Land, TX"
26580 "Huntington-Ashland, WV-KY-OH"
26620 "Huntsville, AL"
26820 "Idaho Falls, ID"
26900 "Indianapolis, IN"
26980 "Iowa City, IA"
27100 "Jackson, MI"
27140 "Jackson, MS"
27260 "Jacksonville, FL"
27340 "Jacksonville, NC"
27500 "Janesville-Beloit, WI"
27740 "Johnson City, TN"
27780 "Johnstown, PA"
27900 "Joplin, MO*"
27980 "Kahului-Wailuku-Lahaina, HI"
28020 "Kalamazoo-Portage, MI"
28100 "Kankakee-Bradley, IL*"
28140 "Kansas City, MO-KS"
28420 "Kennewick-Richland, WA"
28660 "Killeen-Temple-Fort Hood, TX"
28700 "Kingsport-Bristol, TN-VA"
28740 "Kingston, NY*"
28940 "Knoxville, TN"
29100 "La Crosse, WI-MN*"
29180 "Lafayette, LA"
29200 "Lafayette-West Lafayette, IN"
29340 "Lake Charles, LA"
29460 "Lakeland-Winter Haven, FL"
29540 "Lancaster, PA"
29620 "Lansing-East Lansing, MI"
29700 "Laredo, TX"
29740 "Las Cruces, NM"
29820 "Las Vegas-Paradise, NV"
29940 "Lawrence, KS*"
30020 "Lawton, OK*"
30340 "Lewiston-Auburn, ME"
30460 "Lexington-Fayette, KY"
30780 "Little Rock-North Little Rock, AR"
30980 "Longview, TX"
31080 "Los Angeles-Long Beach-Anaheim, CA (Note the CBSA code change between 2003 and 2013)"
31100 "Los Angeles-Long Beach-Santa Ana, CA*"
31140 "Louisville, KY-IN"
31180 "Lubbock, TX"
31340 "Lynchburg, VA*"
31420 "Macon, GA"
31460 "Madera, CA*"
31540 "Madison, WI"
31700 "Manchester-Nashua, NH"
32580 "McAllen-Edinburg-Mission, TX"
32780 "Medford, OR"
32820 "Memphis, TN-MS-AR"
32900 "Merced, CA*"
33100 "Miami-Fort Lauderdale-West Palm Beach, FL"
33140 "Michigan City-La Porte, IN*"
33260 "Midland, TX*"
33340 "Milwaukee-Waukesha-West Allis, WI"
33460 "Minneapolis-St Paul-Bloomington, MN-WI"
33660 "Mobile, AL"
33700 "Modesto, CA"
33740 "Monroe, LA"
33780 "Monroe, MI"
33860 "Montgomery, AL"
34060 "Morgantown, WV"
34580 "Mount Vernon-Anacortes, WA"
34740 "Muskegon-Norton Shores, MI"
34820 "Myrtle Beach-Conway-North Myrtle Beach, SC-NC"
34900 "Napa, CA*"
34940 "Naples-Immokalee-Marco Island, FL"
34980 "Nashville-Davidson-Murfreesboro, TN"
35300 "New Haven-Milford, CT"
35380 "New Orleans-Metairie, LA"
35620 "New York-Newark- Jersey City, NY-NJ-PA (White Plains central city recoded to balance of metropolitan)"
35660 "Niles-Benton Harbor, MI"
35840 "North-Port-Sarasota-Bradenton, FL"
35980 "Norwich-New London, CT"
36100 "Ocala, FL"
36140 "Ocean City, NJ*"
36220 "Odessa, TX"
36260 "Ogden-Clearfield, UT"
36420 "Oklahoma City, OK"
36500 "Olympia, WA*"
36540 "Omaha-Council Bluffs, NE-IA"
36740 "Orlando, FL"
36780 "Oshkosh-Neenah, WI"
37100 "Oxnard-Thousand Oaks-Ventura, CA"
37340 "Palm Bay-Melbourne-Titusville, FL"
37460 "Panama City, FL"
37860 "Pensacola-Ferry Pass-Brent, FL"
37900 "Peoria, IL"
37980 "Philadelphia-Camden-Wilmington, PA-NJ-DE"
38060 "Phoenix-Mesa-Scottsdale, AZ"
38220 "Pine Bluff, AR"
38300 "Pittsburgh, PA"
38860 "Portland-South Portland, ME"
38900 "Portland-Vancouver-Hillsboro, OR-WA"
38940 "Port St. Lucie-Fort Pierce, FL"
39100 "Poughkeepsie-Newburgh-Middletown, NY*"
39140 "Prescott, AZ"
39300 "Providence-Warwick, RI-MA"
39340 "Provo-Orem, UT"
39380 "Pueblo, CO*"
39460 "Punta Gorda, FL*"
39540 "Racine, WI"
39580 "Raleigh, NC"
39740 "Reading, PA"
39820 "Redding, CA"
39900 "Reno-Sparks, NV*"
40060 "Richmond, VA"
40140 "Riverside-San Bernardino-Ontario, CA"
40220 "Roanoke, VA"
40380 "Rochester, NY"
40420 "Rockford, IL"
40900 "Sacramento--Arden-Arcade–Roseville, CA"
40980 "Saginaw, MI"
41060 "St. Cloud, MN*"
41100 "St. George, UT"
41180 "St. Louis, MO-IL"
41420 "Salem, OR"
41500 "Salinas, CA"
41540 "Salisbury, MD"
41620 "Salt Lake City, UT"
41700 "San Antonio, TX"
41740 "San Diego-Carlsbad-San Marcos, CA"
41860 "San Francisco-Oakland-Fremont, CA"
41940 "San Jose-Sunnyvale-Santa Clara, CA"
42020 "San Luis Obispo-Paso Robles, CA"
42060 "Santa Barbara-Santa Maria-Goleta, CA*"
42100 "Santa Cruz-Watsonville, CA"
42140 "Santa Fe, NM"
42220 "Santa Rosa-Petaluma, CA"
42260 "Sarasota-Bradenton-Venice, FL*"
42340 "Savannah, GA"
42540 "Scranton--Wilkes-Barre, PA"
42660 "Seattle-Tacoma-Bellevue, WA"
43300 "Sherman-Dennison, TX"
43340 "Shreveport-Bossier City, LA"
43620 "Sioux Falls, SD"
43780 "South Bend-Mishawaka, IN-MI"
43900 "Spartanburg, SC"
44060 "Spokane-Spokane Valley, WA"
44100 "Springfield, IL"
44140 "Springfield, MA"
44180 "Springfield, MO"
44220 "Springfield, OH*"
44700 "Stockton, CA"
45060 "Syracuse, NY"
45220 "Tallahassee, FL"
45300 "Tampa-St. Petersburg-Clearwater, FL"
45460 "Terre Haute, IN"
45780 "Toledo, OH"
45820 "Topeka, KS"
45940 "Trenton, NJ"
46060 "Tucson, AZ"
46140 "Tulsa, OK"
46220 "Tuscaloosa, AL*"
46340 "Tyler, TX"
46520 "Urban Honolulu, HI"
46540 "Utica-Rome, NY"
46660 "Valdosta, GA*"
46700 "Vallejo-Fairfield, CA"
46940 "Vero Beach, FL"
47020 "Victoria, TX*"
47220 "Vineland-Bridgeton, NJ"
47260 "Virginia Beach-Norfolk-Newport News, VA-NC"
47300 "Visalia-Porterville, CA"
47380 "Waco, TX"
47580 "Warner Robins, GA"
47900 "Washington-Arlington-Alexandria, DC-VA-MD-WV"
47940 "Waterloo-Cedar Falls, IA"
48060 "Watertown-Fort Drum, NY"
48140 "Wausau, WI"
48620 "Wichita, KS"
48660 "Wichita Falls, TX"
48700 "Williamsport, PA"
49020 "Winchester, VA-WV"
49180 "Winston-Salem, NC"
49340 "Worcester, MA-CT"
49420 "Yakima, WA*"
49620 "York-Hanover, PA"
49660 "Youngstown-Warren-Boardman, OH-PA"
49740 "Yuma, AZ"
70750 "Bangor, ME"
70900 "Barnstable Town, MA"
71650 "Boston-Cambridge-Quincy, MA-NH"
71950 "Bridgeport-Stamford-Norwalk, CT"
72400 "Burlington-South Burlington, VT"
72850 "Danbury, CT"
73450 "Hartford-West Hartford-East Hartford, CT"
74500 "Leominster-Fitchburg-Gardner, MA"
75700 "New Haven, CT"
76450 "Norwich-New London, CT-RI"
76750 "Portland-South Portland, ME"
77200 "Providence-Fall River-Warwick, RI-MA"
77350 "Rochester-Dover, NH-ME"
78100 "Springfield, MA-CT"
78700 "Waterbury, CT"
79600 "Worcester, MA-CT"
;
#delimit cr

lab val smsastat14 smsastat14
lab var smsastat14 "Metro CBSA FIPS Code"
notes smsastat14: CPS: h-metsta gemetsta gtcbsa
notes smsastat14: May 2014-on

/* Metropolitan Area (CBSA) Size */

gen cbsasz=.

if 1995<=`year' & `year'<=1997 {
*only available Sept 1995-on
replace cbsasz=gemsasz
}
if 1998<=`year' & `year'<=2002 {
replace cbsasz=gtmsasz
}
if `year'==2003 {
replace cbsasz=gemsasz
}
if `year'==2004 {
replace cbsasz=gemsasz if (1<=month & month<=4)
replace cbsasz=gtcbsasz if (5<=month & month<=12)
}
if 2005<=`year' & `year'<=2016 {
replace cbsasz=gtcbsasz
}
#delimit ;
lab define cbsasz
0 "Not identified or nonmetropolitan"
2 "100,000-249,999"
3 "250,000-499,999"
4 "500,000-999,999"
5 "1,000,000-2,499,999"
6 "2,500,000-4,999,999"
7 "5,000,000+"
;
#delimit cr
lab val cbsasz cbsasz
lab var cbsasz "CBSA Size"
notes cbsasz: Available Sept 95-on
notes cbsasz: CPS: gemsasz, gtmsasz, gtcbsasz
notes cbsasz: Called MSA/PMSA size April 2004 and prior

/* Consolidated Statistical Areas (CSA) Codes - gtcsa */

 
if 2005<=`year' & `year'<=2013 {
replace cmsacode05=gtcsa
}

if `year'==2014 {
    replace cmsacode05=gtcsa if (1<=month & month<=4)
    replace cmsacode14=gtcsa if (5<=month & month<=12)
}

if 2015<=`year' & `year'<=2016 {
replace cmsacode14=gtcsa
}


#delimit ;
lab define cmsacode05
118 "Appleton-Oshkosh-Neenah, WI"
176 "Chicago-Naperville-Michigan City, IL-IN-WI (part)"
178 "Cincinnati-Middletown-Wilmington, OH-KY-IN (part)"
184 "Cleveland-Akron-Elyria, OH (part)"
206 "Dallas-Fort Worth, TX (part)"
212 "Dayton-Springfield-Greenville, OH (part)"
216 "Denver-Aurora-Boulder, CO"
220 "Detroit-Warren-Flint, MI"
260 "Fresno-Madera, CA"
266 "Grand Rapids-Muskegon-Holland, MI (part)"
268 "Greensboro-Winston-Salem-High Point, NC (part)"
272 "Greenville-Anderson-Seneca, SC (part)"
288 "Houston-Baytown-Huntsville, TX (part)"
290 "Huntsville-Decatur, AL"
294 "Indianapolis-Anderson-Columbus, IN (part)"
304 "Johnson City-Kingsport-Bristol, TN-VA (part)"
348 "Los Angeles-Long Beach-Riverside, CA"
356 "Macon-Warner-Robins-Fort Valley, GA (part)"
376 "Milwaukee-Racine-Waukesha, WI"
378 "Minneapolis-St. Paul-St. Cloud, MN-WI (part)"
408 "New York-Newark-Bridgeport, NY-NJ-CT-PA (part)"
428 "Philadelphia-Camden-Vineland, PA-NJ-DE-MD (part)"
450 "Raleigh-Durham-Cary, NC (part)"
472 "Sacramento-Arden-Arcade-Truckee, CA-NV (part)"
482 "Salt Lake City-Ogden-Clearfield, UT (part)"
488 "San Jose-San Francisco-Oakland, CA"
500 "Seattle-Tacoma-Olympia, WA (part)"
548 "Washington-Baltimore-Northern Virginia, DC-MD-VA-WV (part)"
715 "Boston-Worcester-Manchester, MA-NH-CT-ME (part)"
720 "Bridgeport-New Haven-Stamford, CT"
;
#delimit cr


lab var cmsacode05 "CSA Code"
lab val cmsacode05 cmsacode05
notes cmsacode05: CPS: gtcsa
notes cmsacode05: Consistent from 2005-April 2014

#delimit ;
lab define cmsacode14
104 "Albany-Schenectady, NY"
106 "Albuquerque-Santa Fe-Las Vegas, NM"
118 "Appleton-Oshkosh-Neenah, WI"
122 "Atlanta--Athens-Clarke County—Sandy Springs, GA"
148 "Boston-Worcester-Providence, MA-RI-NH-CT"
162 "Cape Coral-Fort Myers-Naples, FL"
168 "Cedar Rapids-Iowa City, IA"
170 "Charleston-Huntington-Ashland, WV-OH-KY"
174 "Chattanooga-Cleveland-Dalton, TN-GA"
176 "Chicago-Naperville-Michigan City, IL-IN-WI"
184 "Cleveland-Akron-Canton, OH (part)"
194 "Columbus-Auburn-Opelika, GA-AL"
206 "Dallas-Fort Worth, TX-OK"
212 "Dayton-Springfield, OH"
216 "Denver-Aurora, CO"
220 "Detroit-Warren-Ann Arbor, MI"
238 "El Paso-Las Cruses, TX-NM"
260 "Fresno-Madera, CA"
266 "Grand Rapids-Wyoming-Muskegon, MI"
268 "Greensboro--Winston-Salem–High Point, NC"
272 "Greenville-Anderson-Seneca, SC"
273 "Greenville-Spartanburg-Anderson, SC"
276 "Harrisburg-York-Lebanon, PA"
278 "Hartford-West Hartford, CT"
290 "Huntsville-Decatur, AL"
294 "Indianapolis-Anderson-Columbus, IN"
304 "Johnson City-Kingsport-Bristol, TN-VA (part)"
310 "Kalamazoo-Battle Creek-Portage, MI"
340 "Little Rock-North Little Rock, AR"
348 "Los Angeles-Long Beach-Riverside, CA"
356 "Macon-Warner Robins-Fort Valley, GA"
357 "Madison-Janesville-Beloit, WI"
370 "Miami-Fort Lauderdale-Port St. Lucie, FL"
376 "Milwaukee-Racine-Waukesha, WI"
378 "Minneapolis-St. Paul-St. Cloud, MN"
380 "Mobile-Daphne-Fairhope, AL"
408 "New York-Newark-Bridgeport, NY-NJ-CT-PA (part)"
422 "Orlando-Deltona-Daytona Beach, FL"
428 "Philadelphia-Reading-Camden, PA-NJ-DE-MD"
438 "Portland-Lewiston-South Portland, ME"
440 "Portland-Vancouver-Salem, OR-WA"
450 "Raleigh-Durham-Cary, NC"
482 "Salt Lake City-Provo-Orem, UT"
488 "San Jose-San Francisco-Oakland, CA"
500 "Seattle-Tacoma-Olympia, WA"
515 "South Bend-Elkhart-Mishawaka, IN-MI"
518 "Spokane-Spokane Valley-Coeur d’Alene, WA-ID"
546 "Visalia-Porterville-Hanford, CA"
548 "Washington-Baltimore-Arlington, DC-MD-VA-WV-PA"
715 "Boston-Worcester-Manchester, MA-NH-CT-ME"
720 "Bridgeport-New Haven-Stamford, CT"
;
#delimit cr


lab var cmsacode14 "CSA Code"
lab val cmsacode14 cmsacode14
notes cmsacode14: CPS: gtcsa
notes cmsacode14: Consistent from May 2014-on

/* Big cities */

	/* New York */

gen byte nyc=.
gen byte la=.

if 2005<=`year' & `year'<=2020 {
replace nyc=0 if 460<=gtcbsa & gtcbsa<=79600
replace nyc=1 if gtcbsa==35620
}
lab var nyc "New York City, metro area"
notes nyc: Combine with centcity for NYC only
notes nyc: New York-Northern, NJ-Long Island, NY

	/* Los Angeles */

if 2005<=`year' & `year'<=2013 {
replace la=0 if 460<=gtcbsa & gtcbsa<=79600
replace la=1 if gtcbsa==31100
}

if `year'==2014 {
replace la=0 if 460<=gtcbsa & gtcbsa<=79600
replace la=1 if gtcbsa==31100 & (1<=month & month<=4)
replace la=1 if (gtcbsa==31100 | gtcbsa==31080) & (5<=month & month<=12)
}

if 2015<=`year' & `year'<=2020 {
replace la=0 if 460<=gtcbsa & gtcbsa<=79600
replace la=1 if (gtcbsa==31100 | gtcbsa==31080)
}

lab var la "Los Angeles, metro area"
notes la: Combine with centcity for LA only
notes la: Los Angeles-Long Beach-Santa Ana


	/* TEMPORARILY NOT AVAILABLE

	/* smsa70 */
if (1986<=`year' & `year'<=2006) {/* smsa70 not available */}
	/* smsa80 */
if (1979<=`year' & `year'<=1984) | /*
*/ (1996<=`year' & `year'<=2006) {/* smsa80 not available */}
	/* smsa93 */
if (1994<=`year' & `year'<=2006) {/* smsa93 not available */}	
notes smsa93: Available 1995:9-
	/* smsarank */
if (1986<=`year' & `year'<=2006) {/* smsarank not available */}
notes smsarank: Available 1979-1985:6
	/* cmsarank */
if (1979<=`year' & `year'<=1985) | /*
*/ (1986<=`year' & `year'<=2006) {
/* cmsarank not available */
}
notes cmsarank: Available 1986-1994:3
notes cmsarank: CPS: hg-msar, gemsark
	/* pmsarank */
if (1979<=`year' & `year'<=1985) | /*
*/ (1986<=`year'  & `year'<=2006) {/* pmsarank not available */}
notes pmsarank: Available 1986-1994:3
notes pmsarank: CPS: hg-pmsa, gepmsrk
	/* icntcity */
if (1979<=`year' & `year'<=1985) { /* icntcity not available */ }
if `year'==1991 {replace icntcity=hdindvcc}
if (1994<=`year' & `year'<=2004) {
replace icntcity=geindvcc if (1<=geindvcc & geindvcc<=4)
}
if (2005<=`year' & `year'<=2006) { 
/* status unknown */ 
}
notes icntcity: Available 1986-
notes icntcity: CPS: h-inducc, h0indvcc geindvcc
	/* msafips */
if 1979<=`year' & `year'<=1988 {/* msafips not available */}
if `year'==1991 {replace msafips=hgdmsac}
if 1994<=`year' & `year'<=2004 {
replace msafips=gemsa if 0<gemsa & gemsa<=9360
}
if 2005<=`year' & `year'<=2006 {/* status unknown */}
notes msafips: Available 1989-94 
notes msafips: Available 1995:1-1995:5; 1995:9-
notes msafips: Coding changes between 1994 and 1995
	/* cmsacode */
if 1979<=`year' & `year'<=1988 {/* cmsacode not available */}
if `year'==1991 {replace cmsacode=hgdcmsa}
if `year'==1994 {/* cmsacode not available */}
if 1995<=`year' & `year'<=2004 {
*replace cmsacode=gecmsa if 0<gecmsa & gecmsa<=97
}
if 2005<=`year' & `year'<=2006 {/* status unknown */}
notes cmsacode: Available 1989-1993
notes cmsacode: Available 1994:1-1994:3; 1995:9-

		*/

/* 
Copyright 2020 CEPR and John Schmitt

This file is part of the cepr_org_master.do program. This file and all
programs referenced in it are free software. You can redistribute the
program or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
USA.
*/

